package net.lab1024.sa.admin.module.business.ai.controller;

import net.lab1024.sa.admin.module.business.ai.entity.AiRolePromptEntity;
import net.lab1024.sa.admin.module.business.ai.service.AiRolePromptService;
import net.lab1024.sa.base.common.domain.ResponseDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;

@RestController
@RequestMapping("/api/ai/role-prompt")
public class AiRolePromptController {
    @Autowired
    private AiRolePromptService aiRolePromptService;

    @GetMapping("/list/{roleId}")
    public ResponseDTO<List<AiRolePromptEntity>> listByRoleId(@PathVariable Long roleId) {
        return ResponseDTO.ok(aiRolePromptService.listByRoleId(roleId));
    }

    @PostMapping("/")
    public ResponseDTO<Void> add(@RequestBody AiRolePromptEntity entity) {
        aiRolePromptService.add(entity);
        return ResponseDTO.ok();
    }

    @PutMapping("/")
    public ResponseDTO<Void> update(@RequestBody AiRolePromptEntity entity) {
        aiRolePromptService.update(entity);
        return ResponseDTO.ok();
    }

    @DeleteMapping("/{id}")
    public ResponseDTO<Void> delete(@PathVariable Long id) {
        aiRolePromptService.delete(id);
        return ResponseDTO.ok();
    }
} 